package com.purchase.manage.mapper;

import com.purchase.manage.damian.DAO.SupplierDAO;
import com.purchase.manage.damian.Supplier;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface ManageSupplierMapper {
    //检测供应商是否重复
    int checkSupplier(@Param("handledByPhone") String handledByPhone);

    //查看 供应商的审核进度
    String checkSupplierState(@Param("handledByPhone") String username);

    //添加供应商进 供应商信息表
    int insertSupplier(SupplierDAO supplier);

    //供应商列表查询
    List<Supplier> selectSupplierList(SupplierDAO supplierDAO);

    //查找
    Supplier selectSupplierById(@Param("id") Long supplierId);


    //添加进用户表
    void insertUser(Supplier supplier);

    //添加进权限表
    void insertRoleUser(@Param("id") Long supplierId);

    //添加进用户供应商关系表
    void insertSysUserSupplier(@Param("uid") String uid, @Param("suid") Long supplierId);


    //修改供应商信息
    int updateSupplier(SupplierDAO supplier);

    //修改供应商评分
    void updateScore(@Param("supplierId") Long supplierId,@Param("score") BigDecimal score);

    //根据用户id 得到供应商id
    Long selectSupplierId(@Param("supplierId")Long supplier1);

    //
    void updateState(@Param("id")Long orderId);

    String getMname(@Param("s") String s);
}
